package day16.feifei.homework;

//import com.sun.org.apache.bcel.internal.generic.NEW;

import java.io.*;

public class CopyTo {
    static byte[] letters;

    // 该代码块永远只会加载一次
    static {
        letters = new byte[26 + 26 + 10];
        for (byte i = 65; i <= 90; i++) { // 26
            letters[i - 65] = i;// 0,1,2,....
            letters[i - 65 + 26] = (byte) (i + 32);// a--->z
        }
        // 0-9
        for (byte i = 0; i < 10; i++) {
            letters[i + 52] = (byte) (48 + i);
        }
    }

    public static void main(String[] args) throws IOException {
        File file = new File("D:\\file\\work\\我的青春谁做主.txt");
        boolean newFile = file.createNewFile();
        OutputStream op = new FileOutputStream(file);
        op.write(letters);
        op.close();
        File file2 = new File("D:\\file\\work\\Prime.txt");

        InputStream is = new FileInputStream(file);
        OutputStream op2 = new FileOutputStream(file2);
        while (true) {
            int read = is.read();
            if (read >= 0) {
                op2.write(read);
            }else break;
        }
    }
}
